// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
// import Vue from 'vue'
// import ElementUI from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css'
// import App from './App'
// import router from './router'
//
// import 'normalize.css'
// import 'vue-awesome/icons'
// import Icon from 'vue-awesome/components/Icon'
//
//
// Vue.config.productionTip = false
//
// Vue.use(ElementUI)
// Vue.component('icon', Icon)
//
// /* eslint-disable no-new */
// new Vue({
//   el: '#app',
//   router,
//   components: { App },
//   template: '<App/>'
// })

import Vue from 'vue'
import Axios from 'axios'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import 'normalize.css'
import 'vue-awesome/icons'
import Icon from 'vue-awesome/components/Icon'

import App from './App'
import router from './router'
//导入全局注册组件 : 已注册的组件可以被全局引用了
import './components/global/globalIndex'

Vue.config.productionTip = false

//引入mock
// require('./mockjs')
// import axios from 'axios'

Vue.use(ElementUI)
// Vue.prototype.$httphttp = Axios;
Vue.component('icon', Icon)
Vue.prototype.$http = Axios


/**自定义全局方法*/
Vue.prototype.setErrMessage = function (msg){
  this.$message({ message: msg, type: 'error',duration:2000});
};
Vue.prototype.setSucMessage = function (msg){
  this.$message({ message: msg, type: 'success',duration:2000});
};
Vue.prototype.setWarnMessage = function (msg){
  this.$message({ message: msg, type: 'warning',duration:2000});
};
//提示信息
Vue.prototype.Info = function (msg){
  this.$message.info(msg)
};
//重form参数
Vue.prototype.resetForm = function (obj){
  for(var item in obj){
    obj[item]=null;
  }
};
//  拦截响应response，并做一些错误处理
// $http.interceptors.response.use((response) => {
//   const data = response.data;
//   return data;
// }, function (err) {
//  // console.log(err.response.status);
//    if (err.response.status == 404) {
//      router.replace({
//        path: "/login"
//      });
//    }
// });


// const Bus = new Vue()
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  // data:{
  //   Bus : Bus
  // },
  template: '<App/>',
  components: { App }
})



